package com.dl.study.service.impl;

import com.dl.study.service.FlowService;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.Deployment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: denglei
 * @Date: 2021/12/8 14:24
 * @Description:
 */
@Service
@Slf4j
public class FlowServiceImpl implements FlowService {

    @Autowired
    private RepositoryService repositoryService;
    @Autowired
    private TaskService taskService;
    @Autowired
    private RuntimeService runtimeService;
    @Autowired
    private HistoryService historyService;

    @Override
    public Object createDeploy() {
        Deployment deployment = repositoryService.createDeployment()
                ///添加bpmn资源
                .addClasspathResource("processes/leave.bpmn")
                .addClasspathResource("processes/leave.png")
                .name("请假申请单流程")
                .deploy();
        log.info("流程部署id:" + deployment.getId());
        log.info("流程部署名称:" + deployment.getName());
        return "成功";
    }

    /**
     * 部署流程实例
     */


}
